<?php 
include '../data/data.php';
$user=$_SESSION['user']; //获取到的用户名
$pass=$_SESSION['pass']; //获取到的密码
$gid=intval($_GET['game_id']);
$result= mysql_query("SELECT * FROM games WHERE id='$gid' and userid LIKE '%$dl%'", $link);  
$row = mysql_fetch_array($result);
if($row[type]=='MV'){
      $cbx='满V版';
      }elseif($row[type]=='BT'){
      $cbx='超变版';
      }elseif($row[type]=='GM'){
      $cbx='GM版';
      }elseif($row[type]=='H5'){
      $cbx='H5版';
}
if($row[id]!=''){
}else{
	header('location:/index.html');
}
mysql_query("UPDATE games SET renqi=renqi+'1' WHERE id='$gid'", $link);
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" content="<?php echo $row[name].$cbx; ?> GM后台版 角色扮演 H5 HTML5 H5游戏 HTML5游戏 小游戏 手机游戏 网页游戏 在线游戏 点击即玩 <?php echo $rowx[name]; ?> <?php echo $rowx[name]; ?>">
<meta name="description" content="10元无限,GM后台道具随便刷">
<title><?php echo $row[name].$cbx; ?> - 热门H5游戏平台</title>

  <?php require_once('css.php') ?>
<div id="__nuxt"><!---->
    <div id="__layout">
        <section id="__app" class="h5"><!----><!---->
            <section class="router-view">
                <section data-v-47449436="" class="app container">
                    <div data-v-47449436="" class="return-btn">
                    	<span data-v-47449436="" onclick="javascript :history.back(1);" class="el-icon-arrow-left"></span>
                    	</div>
                    <div data-v-47449436="" class="blur"><img data-v-47449436="" src="<?php echo $row[logo]; ?>">
                    </div>
                    <div data-v-47449436="" class="icon box box-center"><img data-v-47449436="" data-src="<?php echo $row[logo]; ?>" src="<?php echo $row[logo]; ?>" lazy="loaded"></div>
                    <div data-v-47449436="" class="info has-border-bottom bold">
                        <div data-v-47449436="" class="row name" style="margin-top: 0px;"><?php echo $row[name]; ?></div>
                        <div data-v-47449436="" class="row label-list"><span data-v-47449436="" class="label"><?php echo $row[zdy1]; ?></span>
                        <span data-v-47449436="" class="label"><?php echo $row[zdy2]; ?></span>
                        <span data-v-47449436="" class="label gray"><?php echo $row[zdy3]; ?></span>
                        </div>
                        <div data-v-47449436="" class="row intro hide-text one cl-basic">
                            <?php echo $row[jianjie]; ?>                        </div>
                        <div data-v-47449436="" class="row number box">
                            <div data-v-47449436="" class="text box-1 cl-basic"><p data-v-47449436="">
                                    已有
                                    <span data-v-47449436="" class="cl-main-deep"><?php echo $row[renqi]; ?></span>
                                    玩过此游戏
                                </p>
                                <p data-v-47449436="">
                                    有
                                    <span data-v-47449436="" class="cl-main-deep">758人</span>
                                    申请过返利
                                </p></div>
                            <div data-v-47449436="" class="image">
                              <?php
                               if($row[type]=='GM'){
                                  ?>
                      <a target="_top" style="background: #FF7200;top: 200%;left: 0;"  href="/game/gback.html?game_id=<?php echo $row[id]; ?>" class="btn_blue"><img data-v-47449436="" src="./img/GM.jpg"></a>
                      <?php
                               }else{
                      ?>
                              <img data-v-47449436="" src="./img/fan.74cc896.png">
                              <?php
                              	
                      }
                              ?>
                          </div>
                        </div>
                    </div>
                    
                    <div data-v-47449436="" class="game-info content has-border-bottom">
                        <div data-v-47449436="" class="title">游戏信息</div>
                        <ul data-v-47449436="" class="image-list box">
                          <?php
                           if($row[tua]!=''){
                          ?>
                          <li data-v-47449436="">
                            	<img data-v-47449436="" data-src="<?php echo $row[name].$cbx; ?> 游戏截图" src="<?php echo $row[tua]; ?>" lazy="loaded">
                            </li>
                         <?php
                          }
                          ?>
                        	 <?php
                           if($row[tub]!=''){
                          ?>
                          <li data-v-47449436="">
                            	<img data-v-47449436="" data-src="<?php echo $row[name].$cbx; ?> 游戏截图" src="<?php echo $row[tub]; ?>" lazy="loaded">
                            </li>
                         <?php
                          }
                          ?>
                           <?php
                           if($row[tuc]!=''){
                          ?>
                          <li data-v-47449436="">
                            	<img data-v-47449436="" data-src="<?php echo $row[name].$cbx; ?> 游戏截图" src="<?php echo $row[tuc]; ?>" lazy="loaded">
                            </li>
                         <?php
                          }
                          ?>
                          </ul>
                        <p data-v-47449436="" class="text toggle-height hide cl-basic">
                            </p><p><br></p><?php echo $row[jieshao]; ?><span data-v-47449436="" class="el-icon-arrow-down"></span></div>
                    
                    <div data-v-47449436="" class="likeapps content">
                        <div data-v-47449436="" class="title">相关游戏</div>
                        <ul data-v-47449436="" class="applist box">
                          <?php
                          $sql1 = "SELECT id, logo, name FROM games WHERE userid LIKE '%$dl%' and type ='BT' ORDER BY pai DESC limit 10";
				$result1 = $conn->query($sql1);

if ($result1->num_rows > 0) {
    // 输出数据
    while($row1 = $result1->fetch_assoc()) {

echo ' <li data-v-47449436="">
                                <div data-v-d077d592="" data-v-47449436="" class="app-vertical"><a data-v-d077d592="" href="/game/detail.html?game_id='.$row1[id].'">
                                        <div data-v-d077d592="" class="icon"><img data-v-d077d592="" data-src="'.$row1[logo].'" src="'.$row1[logo].'" lazy="loading"></div>
                                        <div data-v-d077d592="" class="name hide-text one">'.$row1[name].'</div>
                                        <div data-v-d077d592="" class="label hide-text one">强烈推荐</div>
                                    </a></div>
                            </li>';
    }
}


                            
                        echo '</ul>
                    </div>';
?>
                          
                    <div data-v-47449436="" class="footer">
                      <?php
                      if($row[type]!='GM'){
                      if($row[ty]=='0'){
                      		echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[Android].'" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">开始玩</span></button></a>';
                      }elseif($row[ty]=='1'){
                       		if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
                                if($row[ios]!=''){
                                  	echo '<a target="_top" id="phone" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">苹果下载</span></button></a>';
                                }else{
                                  	echo '<a target="_top" onclick="countDownload(this,100)" href="#" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">暂无下载</span></button></a>';
                                }
							}else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
                                if($row[Android]!=''){
                                    echo '<a target="_top"  id="android" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">安卓下载</span></button></a>';
                                }else{
                                    echo '<a target="_top"  onclick="countDownload(this,100)"  href="#" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">暂无下载</span></button></a>';
                                }
							}else{
                                if($row_Recordset1[anzhuo]!=''){
                                      echo '<a target="_top"   id="android" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">点击下载</span></button></a>';
                                }else{
                                     echo '<a target="_top"   id="android" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">安卓下载</span></button></a>';
                               }
						    }
                      } 
                      }else{
                      if($row[ty]=='0'){
                      		echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[Android].'" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">开始玩</span></button></a>';
                      }elseif($row[ty]=='1'){
                                  	echo '<a target="_top" href="xz.html?game_id='.$row[id].'" class="btn_blue"><button data-v-47449436="" class="ios"><span data-v-47449436="">立即下载</span></button></a>';
                      } 
                      }
                      ?>
                     
                        	
                    </div>
                </section>
            </section><!---->
            <div class="el-dialog__wrapper" style="display:none;">
                <div role="dialog" aria-modal="true" aria-label="请选择下载的版本" class="el-dialog download-dialog mini" style="margin-top:15vh;width:600px;">
                    <div class="el-dialog__header"><span class="el-dialog__title">请选择下载的版本</span>
                        <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button>
                    </div><!----><!----></div>
            </div>
            <div class="el-dialog__wrapper" style="display:none;">
                <div role="dialog" aria-modal="true" aria-label="恭喜您领取礼包成功" class="el-dialog package-dialog" style="margin-top:15vh;width:500px;">
                    <div class="el-dialog__header"><span class="el-dialog__title">恭喜您领取礼包成功</span>
                        <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button>
                    </div><!----><!----></div>
            </div>
            <div class="el-dialog__wrapper" style="display:none;">
                <div role="dialog" aria-modal="true" aria-label="手机号登录" class="el-dialog btgo-dialog" style="margin-top:15vh;width:520px;">
                    <div class="el-dialog__header"><span class="el-dialog__title">手机号登录</span><!----></div><!---->
                    <!----></div>
            </div><!----><!----><!---->
            <section class="h5-menu" style="display:none;" data-v-e4b7e918=""><img src="./神途传奇 - 游戏详情_files/up.e0061ec.png" data-v-e4b7e918=""></section>
            <section class="toast box box-center" style="display:none;">
                <div class="toast-value"></div>
            </section>
            <span><script></script></span></section>
    </div>
</div>  
  <script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.mobile.min.js"></script>
<script src="/layer/layer.js" type="text/javascript"></script>
<script src="/jquery/swipe.js"></script>
<script>
        $('#footer a:eq(2)').attr('id', 'footer_nav_active');
    $(function(){
	$(".z_container").css({"padding-top":0});

	var img_nums = $('#img_slider li').length;
	if( img_nums > 0 ) {
    	var html = (new Array(img_nums + 1)).join('<li></li>');
    	html = $(html);
    	html.eq(0).addClass('active_role');
    	$('.btn_check ul').append(html);
	}
    window.mySwipe = Swipe(document.getElementById('slider'), {
        auto: 2000,
        continuous: true,
        disableScroll: false,
        stopPropagation: false,
        callback: function(index, element) {
            $(".btn_check ul li").eq(index % img_nums).addClass("active_role").siblings().removeClass("active_role");
        }
    });

    //收藏
    var favorited = false;
    var loading = false;
    $('#add_favorite').tap(function(){
        if( '76805' == '' ) {
            if( confirm('还未登录，是否现在去登录？') ) {
                location.href = '/user/login.html?fwd=%2Fgame%2Fdetail.html%3Fgame_id%3D366';
            }
        } else if( ! favorited ) {
            if( loading ) return false;
            loading = true;
            $.post('/user/addfavorite.html?game_id=366', '', function(msg){
                if( msg == 'success' ) {
                    $('#add_favorite img').attr('src', '/images/game_info/info_12.png');
                	favorited = true;
                } else if( msg ) {
                    alert(msg);
                }
                loading = false;
            });
        }
    });
});
</script>
<script>
    $(function(){
        $('.gisows').click(function(){
            var i = $(this).index()
            $(this).siblings().removeClass('gisow');
            $(this).addClass('gisow');
            $('.geion').children().css('display','none');
            $('.geion').children().eq(i).css('display','block');
        });
    });
</script>
<script>
    $('.game_logo').click(function(){
        $(this).addClass('new_imgs');
        var giftid = $('.new_imgs').attr("id");
        giftid = giftid.substring(5);
        var cla = '#changepwdwin_'+giftid;
        var nui = '#gift_'+giftid;
        $(this).removeClass('new_imgs');
        var index = layer.open({
            title: false,
            type: 1,
            skin: 'layui-layer-demo', //样式类名
            closeBtn: 0, //不显示关闭按钮
            anim: 2,
            shadeClose: true, //开启遮罩关闭
            area: ['343px', '290px'], //宽高
            content: $(cla),
        });
    });
    $(function(){
        //领取
        $('.geton').on('tap', function(){
            var cdkey = ' ';
            $(this).addClass('new_get');
            var giftid = $('.new_get').attr("id");
            giftid = giftid.substring(9);
            // $(this).text('复制');
            $(this).removeClass('new_get');
            $.post('/activity/sendout.html', 'gift_id='+giftid+'', function(msg){
                loading = false;
                cdkey = msg.cdkey;
                $('#gift_cdkey').val(msg.cdkey);
                // if( msg.cdkey != '' ) {
                //     $('#gift_get').addClass('btn_gray');
                // }
                if(msg.msg=='还未登录！'){
                    layer.confirm('还未登录，是否跳转登陆', {
                        title: false,
                        btn: ['是','否'] //按钮
                    }, function(){
                        location.href = '/user/login.html?fwd=%2Factivity%2Fgiftbag.html';
                    }, function(){
                    });
                }else{
                    layer.alert('', {
                        title:'礼包码已领取',
                        area: ['323px', '163px'], //宽高
                        content: '请点击复制按钮！',
                        end: function () {
                            location.reload();
                        }
                    });
                }
            }, 'json');
        });
        // $('.getons').click(function(){
        //     var cds = $(this).parents('.fr').find('.texts').val();
        //     layer.alert('', {
        //         title:'礼包码已复制',
        //         area: ['323px', '163px'], //宽高
        //         content: cds,
        //     });
        //     var Url2 = $(this).parents('.fr').find('.texts');
        //     Url2.select(); // 选择对象
        //     document.execCommand("Copy"); // 执行浏览器复制命令
        // });
    });
    function copyUrl(e){
        var Url2 = document.getElementById('mytext_'+e);
        var text=Url2.value;
        var valueLength = text.length;
        selectText(Url2, 0, valueLength);
        if(document.execCommand('copy', false, null)){
            document.execCommand('copy', false, null)// 执行浏览器复制命令
            layer.alert('', {
                title:'礼包码已复制',
                area: ['323px', '163px'], //宽高
                content: text,
            });
        }else{
            console.log("不兼容");
        }
    }
    function selectText(textbox, startIndex, stopIndex) {
        if(textbox.createTextRange) {//ie
            var range = textbox.createTextRange();
            range.collapse(true);
            range.moveStart('character', startIndex);//起始光标
            range.moveEnd('character', stopIndex - startIndex);//结束光标
            range.select();//不兼容苹果
        }else{
            //兼容苹果
            textbox.setSelectionRange(startIndex, stopIndex);
            textbox.focus();
        }
    }
</script>
    <script>
        $('#search_btn').on('tap', function(){
            var v = $.trim($('#search_ipt').val());
            v = v.replace(/[\'\"\?`~\!\$\%\^\*\(\)\[\]\{\}\-\+\\]+/, '');
            $('#search_ipt').val(v);
            if( v == '' ) {
                alert('请输入游戏名称、拼音或关键字！');
                $('#search_ipt').focus();
                return false;
            }
            location.href = '/search.html?search='+ encodeURIComponent(v);
        });
        $('#search_ipt').bind('keydown',function(event){
            if(event.keyCode == "13") {
                var v = $.trim($('#search_ipt').val());
                v = v.replace(/[\'\"\?`~\!\$\%\^\*\(\)\[\]\{\}\-\+\\]+/, '');
                $('#search_ipt').val(v);
                if( v == '' ) {
                    alert('请输入游戏名称、拼音或关键字！');
                    $('#search_ipt').focus();
                    return false;
                }
                location.href = '/search.html?search='+ encodeURIComponent(v);
            }
        });
        $("#search_ipt").mousedown(function(){
            $('.history').css("display","block");;
        });
    </script>
  <script>
    $(function(){
    var id = <?php echo $gid; ?>;
          $('#phone').on('tap', function(){
            $.ajax({
                type: 'POST',
                url: 'dw.php',
                data: 'id='+id+'&type=phone',
                dataType: 'json',
                success:function(data){
			  console.log('data',data);
			 if(data.info=='GM'){
               layer.msg('请先开通包站', {icon: 1, offset: 't', time: 2000, shade: 0.8}, function(){location.href="/pay/deposit.html";});
                return;
             }
             if(data.info=='OK'){
               location.href="<?php echo $row[ios]; ?>";
                return;
             }
             if(data.info=='DL'){
               layer.msg('请先登录', {icon: 1, offset: 't', time: 2000, shade: 0.8}, function(){location.href="/user/user.html";});
                return;
             }
		  },
                error: function(){
                    message('网络连接失败,刷新重试！','','error');
                }
            });
        });
        // android下载
        $('#android').on('tap', function(){
            $.ajax({
                type: 'POST',
                url: 'dw.php',
                data: 'id='+id+'&type=android',
                dataType: 'json',
               success:function(data){
			  console.log('data',data);
			 if(data.info=='GM'){
               layer.msg('请先开通包站', {icon: 1, offset: 't', time: 2000, shade: 0.8}, function(){location.href="/pay/deposit.html";});
                return;
             }
             if(data.info=='OK'){
               location.href="<?php echo $row[Android]; ?>";
                return;
             }
             if(data.info=='DL'){
               layer.msg('请先登录', {icon: 1, offset: 't', time: 2000, shade: 0.8}, function(){location.href="/user/user.html";});
                return;
             }
		  },
                error: function(){
                    message('网络连接失败,刷新重试！','','error');
                }
            });
        });
       });
  </script>
</body>
</html>